namespace RivercrabNet
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Drawing.Drawing2D;

    public class ChartDiv
    {
        private Color bgBeginColor = Color.Black;
        private Brush bgBrush = new SolidBrush(Color.Black);
        private Color bgEndColor = Color.Black;
        private HorizontalScale calenderScale = new HorizontalScale();
        private Pen crossHair_Pen = new Pen(Color.White);
        private ChartTip eventTipObj = new ChartTip();
        private Pen grid_Pen = new Pen(Color.FromArgb(100, Color.Red));
        private int gridInterval = 3;
        private bool isMain = true;
        private VerticalScale leftYScale = new VerticalScale();
        private int maxTitleLine = 3;
        private Dictionary<int, double> maxValue = new Dictionary<int, double>();
        private Dictionary<int, double> minValue = new Dictionary<int, double>();
        private List<PaintLineBase> paintLineList = new List<PaintLineBase>();
        private Pen panelBorder_Pen = new Pen(Color.SkyBlue);
        private int panelID;
        private string panelTitle = string.Empty;
        private Rectangle rect = new Rectangle();
        private VerticalScale rightYScale = new VerticalScale();
        private Dictionary<string, BaseShape> shapeDic = new Dictionary<string, BaseShape>();
        private bool showGrid = true;
        private List<RivercrabNet.UserDefinedTitle> titleFieldList = new List<RivercrabNet.UserDefinedTitle>();
        private Font titleFont = new Font("New Times Roman", 9f);
        private Brush titleFont_Brush = new SolidBrush(Color.White);
        private float titleHeight = 30f;
        private bool userDefinedTitle;
        private int verticalPercent;
        private List<string> yScaleField = new List<string>();

        public ChartDiv()
        {
            this.panelBorder_Pen.DashStyle = DashStyle.Dash;
            this.grid_Pen.DashStyle = DashStyle.Dash;
            this.maxValue[0] = 0.0;
            this.minValue[0] = 0.0;
        }

        ~ChartDiv()
        {
            if (this.panelBorder_Pen != null)
            {
                this.panelBorder_Pen.Dispose();
            }
            if (this.titleFont_Brush != null)
            {
                this.titleFont_Brush.Dispose();
            }
            if (this.grid_Pen != null)
            {
                this.grid_Pen.Dispose();
            }
            if (this.crossHair_Pen != null)
            {
                this.crossHair_Pen.Dispose();
            }
            if (this.bgBrush != null)
            {
                this.bgBrush.Dispose();
            }
        }

        public Color BgBeginColor
        {
            get
            {
                return this.bgBeginColor;
            }
            set
            {
                this.bgBeginColor = value;
            }
        }

        public Brush BgBrush
        {
            get
            {
                return this.bgBrush;
            }
            set
            {
                this.bgBrush = value;
            }
        }

        public Color BgEndColor
        {
            get
            {
                return this.bgEndColor;
            }
            set
            {
                this.bgEndColor = value;
            }
        }

        public HorizontalScale CalenderScale
        {
            get
            {
                return this.calenderScale;
            }
            set
            {
                this.calenderScale = value;
            }
        }

        public Pen CrossHair_Pen
        {
            get
            {
                return this.crossHair_Pen;
            }
            set
            {
                this.crossHair_Pen = value;
            }
        }

        public ChartTip EventTipObj
        {
            get
            {
                return this.eventTipObj;
            }
            set
            {
                this.eventTipObj = value;
            }
        }

        public Pen Grid_Pen
        {
            get
            {
                return this.grid_Pen;
            }
            set
            {
                this.grid_Pen = value;
            }
        }

        public int GridInterval
        {
            get
            {
                return this.gridInterval;
            }
            set
            {
                this.gridInterval = value;
            }
        }

        public bool IsMain
        {
            get
            {
                return this.isMain;
            }
            set
            {
                this.isMain = value;
            }
        }

        public VerticalScale LeftYScale
        {
            get
            {
                return this.leftYScale;
            }
            set
            {
                this.leftYScale = value;
            }
        }

        public int MaxTitleLine
        {
            get
            {
                return this.maxTitleLine;
            }
            set
            {
                this.maxTitleLine = value;
            }
        }

        [Browsable(false)]
        public Dictionary<int, double> MaxValue
        {
            get
            {
                return this.maxValue;
            }
            set
            {
                this.maxValue = value;
            }
        }

        [Browsable(false)]
        public Dictionary<int, double> MinValue
        {
            get
            {
                return this.minValue;
            }
            set
            {
                this.minValue = value;
            }
        }

        public List<PaintLineBase> PaintLineList
        {
            get
            {
                return this.paintLineList;
            }
            set
            {
                this.paintLineList = value;
            }
        }

        public Pen PanelBorder_Pen
        {
            get
            {
                return this.panelBorder_Pen;
            }
            set
            {
                this.panelBorder_Pen = value;
            }
        }

        public int PanelID
        {
            get
            {
                return this.panelID;
            }
            set
            {
                this.panelID = value;
            }
        }

        public string PanelTitle
        {
            get
            {
                return this.panelTitle;
            }
            set
            {
                this.panelTitle = value;
            }
        }

        public Rectangle Rect
        {
            get
            {
                return this.rect;
            }
            set
            {
                this.rect = value;
            }
        }

        public VerticalScale RightYScale
        {
            get
            {
                return this.rightYScale;
            }
            set
            {
                this.rightYScale = value;
            }
        }

        public Dictionary<string, BaseShape> ShapeDic
        {
            get
            {
                return this.shapeDic;
            }
            set
            {
                this.shapeDic = value;
            }
        }

        public bool ShowGrid
        {
            get
            {
                return this.showGrid;
            }
            set
            {
                this.showGrid = value;
            }
        }

        public List<RivercrabNet.UserDefinedTitle> TitleFieldList
        {
            get
            {
                return this.titleFieldList;
            }
            set
            {
                this.titleFieldList = value;
            }
        }

        public Font TitleFont
        {
            get
            {
                return this.titleFont;
            }
            set
            {
                this.titleFont = value;
            }
        }

        public Brush TitleFont_Brush
        {
            get
            {
                return this.titleFont_Brush;
            }
            set
            {
                this.titleFont_Brush = value;
            }
        }

        [Browsable(true)]
        public float TitleHeight
        {
            get
            {
                return this.titleHeight;
            }
            set
            {
                this.titleHeight = value;
            }
        }

        public bool UserDefinedTitle
        {
            get
            {
                return this.userDefinedTitle;
            }
            set
            {
                this.userDefinedTitle = value;
            }
        }

        public int VerticalPercent
        {
            get
            {
                return this.verticalPercent;
            }
            set
            {
                this.verticalPercent = value;
            }
        }

        public List<string> YScaleField
        {
            get
            {
                return this.yScaleField;
            }
            set
            {
                this.yScaleField = value;
            }
        }
    }
}

